home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / ANTENNA / YAGIU112 / MEANPERF.C < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-18  |  964 b   |  24 lines

  1. #include <stdio.h>
  2. #include "yagi.h"
  3.  
  4. void set_mean_structure(struct FCOMPLEX input_impedance, \
  5. double E_fwd, double E_back,struct flags flag, double pin,struct element_data *coordinates, struct FCOMPLEX *current, int elements, double frequency, double design_frequency, struct performance_data *mean_performance)
  6. {
  7.     
  8.     double magnitude,phase,vswr;
  9.     int choice;
  10.     choice=flag.oflg;
  11.     reflection_coefficient(input_impedance,&magnitude,&phase);
  12.     vswr=calculate_vswr(magnitude);
  13.     mean_performance->gain=+E_fwd;
  14.     mean_performance->fb=+(E_fwd-E_back);
  15.     mean_performance->swr=+vswr;
  16.     mean_performance->r=input_impedance.r;   /* in Ohms */
  17.     mean_performance->x=input_impedance.i;   /* in Ohms */
  18.     if((choice&SIDE_LOBE_LEVEL)==SIDE_LOBE_LEVEL  || flag.Tflg || ((flag.Wflg&SIDE_LOBE_LEVEL)==SIDE_LOBE_LEVEL) )
  19.         mean_performance->sidelobe+=find_max_sidelobe_fast(E_fwd, pin,coordinates,current,elements,frequency,design_frequency);
  20.     else
  21.         mean_performance->sidelobe=0.0;
  22. }
  23.  
  24.